import { Dispose } from "../../utils/communicate/result.dispose"; // 统一处理接口返回数据
import api from "../../api/public.api";

const actions = {
    //用户登录
    async Login({ commit }, params) { try { let result = await api.Login(params); return Dispose(result); } catch (error) { return error; } },
    //用户退出
    async Signout({ commit }, params) { try { let result = await api.Signout(params); return Dispose(result); } catch (error) { return error; } },
    //修改密码
    async Modify({ commit }, params) { try { let result = await api.Modify(params); return Dispose(result); } catch (error) { return error; } },
    //获取菜单资源
    async GetMenus({ commit }, params) { try { let result = await api.GetMenus(params); return Dispose(result); } catch (error) { return error; } },
    //修改消息状态
    async PutMessagesState({ commit }, params) { try { let result = await api.PutMessagesState(params); return Dispose(result); } catch (error) { return error; } },
    //删除消息
    async DeteleMessage({ commit }, params) { try { let result = await api.DeteleMessage(params); return Dispose(result); } catch (error) { return error; } },
    //获取消息队列
    async GetMessagesQueue({ commit }, params) { try { let result = await api.GetMessagesQueue(params); return Dispose(result); } catch (error) { return error; } },
    //更新jwt token
    async RefreshToken({ commit }, params) { try { let result = await api.RefreshToken(params); return Dispose(result); } catch (error) { return error; } }
    
};

export { actions };
